package cn.sfrog.project.biz.admin.mapper;


import cn.sfrog.project.biz.admin.domain.BizLiveRoom;

import cn.sfrog.project.biz.admin.domain.vo.BizLiveRoomQueryVO;
import cn.sfrog.project.biz.admin.domain.vo.BizLiveRoomVO;
import cn.sfrog.project.biz.web.vo.room.AppLiveRoomAppointmentVo;
import cn.sfrog.project.biz.web.vo.room.AppLiveRoomResultVO;
import cn.sfrog.system.domain.vo.app.AppLiveRoomQueryVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 直播房间Mapper接口
 * 
 * @author dev
 * @date 2024-05-23
 */
public interface BizLiveRoomMapper extends BaseMapper<BizLiveRoom> {
    /**
     * 查询直播房间
     * 
     * @param id 直播房间主键
     * @return 直播房间
     */
    BizLiveRoomVO selectBizLiveRoomById(Long id);

    /**
     * 查询直播房间列表
     * 
     * @param query 直播房间
     * @return 直播房间集合
     */
    List<BizLiveRoomVO> selectBizLiveRoomList(BizLiveRoomQueryVO query);
    List<AppLiveRoomResultVO> selectBizLiveRoomList4App(AppLiveRoomQueryVO query);

    /**
     * 预约直播
     * @return
     */
    Boolean appointmentByRoomId(@Param("roomId") String roomId, @Param("userId") Long userId);

    Boolean cancelAppointByRoomId(@Param("roomId") String roomId, @Param("userId") Long userId);

    List<Long> selectUserIdsFromAppointmentByRoomId(@Param("roomId") Long roomId);
    List<Long> selectRoomIdsFromAppointmentByUserId(@Param("userId") Long userId);

    int selectIsAppointmentByUserIdAndRoomId(@Param("roomId") String roomId, @Param("userId") Long userId);

}
